package com.wejoy.video.middle.station.admin.controller.evs;/**
 * @Author 张文杰
 * @PackageName video-middle-station
 * @Package com.wejoy.video.middle.station.api.controller
 * @Date 2022/11/21 2:58 PM
 * @Version 1.0
 */

import com.alibaba.fastjson.JSONObject;
import com.wejoy.video.middle.station.data.service.workorder.IEvsCallbackService;
import com.wejoy.video.middle.station.data.vo.RespJSON;
import com.wejoy.video.middle.station.data.vo.workorder.OrderCallBackVO;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.data.redis.core.RedisTemplate;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestBody;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

/**
 * @BelongsProject: video-middle-station
 * @BelongsPackage: com.wejoy.video.middle.station.api.controller
 * @Author: zhangwenjie
 * @CreateTime: 2022-11-21  14:58
 * @Description: EVS回调工单处理
 * @Version: 1.0
 */
@RestController
@RequestMapping("/evs")
public class EvsCallBackContrller {

    @Autowired
    protected RedisTemplate redisTemplate;
    protected Logger logger = LoggerFactory.getLogger(this.getClass());

    @Autowired
    private IEvsCallbackService evsCallbackService;

    @PostMapping("/callback")
    public RespJSON evsCallback(@RequestBody OrderCallBackVO callbackVo){
        logger.info("收到EVS回调->params----->{}", JSONObject.toJSONString(callbackVo));
//        if(callbackVo.getEventStatus().equals(EnumEvsEventStatus.START.getCode())){
            evsCallbackService.initWorkOrder(callbackVo);
//        }else {
//            evsCallbackService.pushPhoto(callbackVo);
//        }
        return RespJSON.success();
    }


}
